package com.stress.testing.plugin.es.strategy;

import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.script.mustache.SearchTemplateRequest;

public class SearchTemplateRequestIndexRenameStrategy extends AbstractRequestIndexRenameStrategy {
    @Override
    public void renameIndex(Object arg) {
        SearchTemplateRequest request = (SearchTemplateRequest) arg;
        SearchRequest searchRequest = request.getRequest();
        searchRequest.indices(internalRenameIndex(searchRequest.indices()));
    }
}
